import Vue from "vue";
//引入vue.js
import VueRouter from "vue-router";
//引入 vue路由js文件

// import Home from "../views/Home.vue";
//引入home组件

Vue.use(VueRouter);
//vue使用vue路由

const routes = [
  {
    path: "/test1",
    name: "test1",
    component: () => import("../views/Test1.vue"),
  },
  {
    path: "/test2",
    name: "test2",
    component: () => import("../views/Test2.vue"),
  },
  {
    path: "/test3",
    name: "test3",
    component: () => import("../views/Test3.vue"),
  },
  // {
  //   path: "/about",
  //   name: "about",
  //   component: () => import("../views/About.vue"),
  //   //路由的懒加载，用户访问这个路径才会加载这个组件
  // },
];
//定义路由规则的地方，在什么路径下加载哪个组件

const router = new VueRouter({
  routes,
});

export default router;
